]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenShield: Don't crash when trying to deactivate the shield
authorJasper St. Pierre <jstpierre@mecheye.net>
Tue, 6 Aug 2013 13:22:48 +0000 (09:22 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Tue, 6 Aug 2013 13:26:51 +0000 (09:26 -0400)
If the user has a lock delay, or deactivate() has been called at
any other time, we need to check for the unlock dialog, as it may
not always exist.

js/ui/screenShield.js

index 151f70b4c20b77f22fbd5af4dcae85c82003faf5..38ac63e7f518e2d5c4cb1b357ad064c771e81ecc 100644 (file)
@@ -1123,9 +1123,12 @@ const ScreenShield = new Lang.Class({
     },
 
     deactivate: function(animate) {
-        this._dialog.finish(Lang.bind(this, function() {
+        if (this._dialog)
+            this._dialog.finish(Lang.bind(this, function() {
+                this._finishDeactivate(animate);
+            }));
+        else
             this._finishDeactivate(animate);
-        }));
     },
 
     _finishDeactivate: function(animate) {